package pf2.pdd.uea;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

/** @author fernando | 23/09/2013 | 06:08:05
 * ProjetoFinal2 | pf2.pdd.uea | CadastroMedicamentoActivity.java :: Copyleft :: 2013. */

public class CadastroMedicamentoActivity extends MainActivity{

	//Definindo constante p ser utilizada nos Logs	
	private static final String CATEGORY = "projeto";

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		finish();
	}


	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// TODO Auto-generated method stub
		return super.onCreateOptionsMenu(menu);
	}


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		super.onClick(v);
		//Armazenar dados do BD Sqlite...
		Toast.makeText(this, "Medicamento Cadastrado.", Toast.LENGTH_LONG).show();
		Intent it_med = new Intent(this, MainActivity.class);
		startActivity(it_med);
	}


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_medicamento);
		
		//Carregando as 5 views peos id... (os TextView não são usados)
		EditText nom_med = (EditText) findViewById(R.id.edt_nome_med);
		EditText hor_med = (EditText) findViewById(R.id.edt_hora_med);
		EditText rep_med = (EditText) findViewById(R.id.edt_rept_med);
		EditText dat_med = (EditText) findViewById(R.id.edt_data_med);
		Button save_med  = (Button) findViewById(R.id.btn_armaz_med);
		
		//Evento de click
		save_med.setOnClickListener(this);
	}

	

}
